#include <stdio.h>

void integer(char *input, char *p_end)
{
    p_end--;
    
    while (*p_end == '0')
        p_end--;

    if (p_end < input)
    {
        printf("0");
    }
    while (p_end >= input)
    {
        printf("%c", *p_end);
        p_end--;
    }
}

void dot(char *input, char *p_dot)
{
    char *p = p_dot - 1;

    //去掉开头的0
    while (*p == '0')
        p--;

    //保留一个0
    if (p < input)
        printf("0");
    
    while (p >= input)
    {
        printf("%c", *p);
        p--;
    }

    printf("%c", *p_dot);

    //p_dot指向第一个非0
    p_dot++;
    while (*p_dot == '0')
        p_dot++;
    
    //保留一个0
    if (!*p_dot)
    {
        printf("0");
    }
    
    //p指向结尾
    p = p_dot;
    while (*p)
        p++;    
    p--;

    while (p >= p_dot)
    {
        printf("%c", *p);
        p--;
    }
}

void fen(char *input, char *p_fen)
{
    char *p = p_fen - 1;

    //去掉开头的0
    while (*p == '0')
        p--;

    //保留一个0
    if (p < input)
        printf("0");

    while (p >= input)
    {
        printf("%c", *p);
        p--;
    }

    printf("%c", *p_fen);

    //p指向结尾
    p = p_fen;
    while (*p)
        p++;    
    p--;

    //去掉0
    while (*p == '0')
        p--;
    
    //保留一个0
    if (p == p_fen)
        printf("0");

    while (p > p_fen)
    {
        printf("%c", *p);
        p--;
    }
}

void bai(char *input, char *p_bai)
{
    p_bai--;
    while (*p_bai == '0')
        p_bai--;
    if (p_bai < input)
    {
        printf("0");
    }
    while (p_bai >= input)
    {
        printf("%c", *p_bai);
        p_bai--;
    }
    printf("%%");
}

int main(int argc, char const *argv[])
{
    char input[32], output[32], *p0, *p1, *p_output;
    p_output = output;
    p0 = gets(input);

    //将p0指向符号
    while (*p0 && *p0 != '.' && *p0 != '/' && *p0 != '%')
        p0++;
    
    switch (*p0)
    {
        case '\0':
            integer(input, p0);
            break;
        case '.':
            dot(input, p0);
            break;
        case '/':
            fen(input, p0);
            break;
        case '%':
            bai(input, p0);
            break;
    }
    
    return 0;
}
